﻿using AutoMapper;
using B.W.traceability.Domain.养殖;
using B.W.traceability.ErrorCode;
using B.W.traceability.Wirte.API.APPlication.TraceabilitCommand;
using MediatR;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;

namespace B.W.traceability.Wirte.API.Controllers
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class TraceabilitController : ControllerBase
    {
        private readonly IMediator mediator;

        public TraceabilitController(IMediator mediator)
        {
            this.mediator = mediator;
        }
        [HttpPost]
        public Task<APIResult<object>> Handle(TraceabilitAddCommand request)
        {
          return mediator.Send(request);
        }
    }
}
